
using System;

namespace MiniBotAlgorithmLibSample
{
    public partial class ApiSamples
    {

        /*
        空间坐标转关节角
        */
        public void Sample_CalTerminalCartesianToJointAngle()
        {
            var pos = new float[6] { 44.11465f, 48.686462f, 36.270172f, 2.8807714f, -0.9503276f, -2.8948553f };

            var intPtrP2 = FloatArrayToIntptr(pos);
            var j2 = MiniBotAlgorithmLib.CalTerminalCartesianToJointAngle(intPtrP2);
            var p2 = IntptrToFloatArray(j2, 5);

            Console.WriteLine($"空间坐标：");
            foreach (var c in pos)
            {
                Console.Write($"{c} ");
            }

            Console.WriteLine();
            Console.WriteLine($"转换成关节角：");
            foreach (var c in p2)
            {
                Console.Write($"{c} ");
            }

        }
    }
}


